home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / -INSTRCT.DIR / Internal_5_Primary Movie Script.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  3.2 KB  |  123 lines

  1. global gPrevSprite, gNextSprite, gInstructStep, gInstructTotal, gWizWindow, gInstructRect, gInstructionWindow, gInstructStart, gTextSprite, gPageList
  2.  
  3. on startMovie
  4.   initText()
  5.   initButtons()
  6.   setButtons()
  7.   displayNewText()
  8. end
  9.  
  10. on closeWindow
  11.   tell the stage
  12.     set gInstructRect to the rect of gInstructionWindow
  13.   end tell
  14.   set the text of member "PageInfo" to " "
  15.   forget(window "Instructions")
  16. end
  17.  
  18. on initText
  19.   set gTextSprite to 1
  20.   puppetSprite(gTextSprite, 1)
  21. end
  22.  
  23. on makePageList
  24.   set myOldDelimiter to the itemDelimiter
  25.   set the itemDelimiter to "-"
  26.   set mySection to item 1 of gInstructStart
  27.   set the itemDelimiter to myOldDelimiter
  28.   set myMemberName to gInstructStart
  29.   set gPageList to []
  30.   repeat while myMemberName contains mySection
  31.     add(gPageList, myMemberName)
  32.     set myMemberName to the name of member (the number of member myMemberName + 1)
  33.   end repeat
  34.   set gInstructTotal to count(gPageList)
  35.   set gInstructStep to 1
  36. end
  37.  
  38. on initButtons
  39.   set gPrevSprite to 2
  40.   set gNextSprite to 3
  41.   puppetSprite(gPrevSprite, 1)
  42.   puppetSprite(gNextSprite, 1)
  43. end
  44.  
  45. on setButtons
  46.   if gInstructTotal = 1 then
  47.     set the member of sprite gPrevSprite to the number of member "PrevDim"
  48.     set the member of sprite gNextSprite to the number of member "NextDim"
  49.   else
  50.     if gInstructStep = 1 then
  51.       set the member of sprite gPrevSprite to the number of member "PrevDim"
  52.       set the member of sprite gNextSprite to the number of member "NextNormal"
  53.     else
  54.       if gInstructStep = gInstructTotal then
  55.         set the member of sprite gPrevSprite to the number of member "PrevNormal"
  56.         set the member of sprite gNextSprite to the number of member "NextDim"
  57.       else
  58.         set the member of sprite gPrevSprite to the number of member "PrevNormal"
  59.         set the member of sprite gNextSprite to the number of member "NextNormal"
  60.       end if
  61.     end if
  62.   end if
  63.   setPage()
  64. end
  65.  
  66. on displayNewText
  67.   makePageList()
  68.   set the member of sprite gTextSprite to gInstructStart
  69.   setButtons()
  70. end
  71.  
  72. on setPage
  73.   set the text of member "PageInfo" to "Page" && gInstructStep && "of" && gInstructTotal
  74. end
  75.  
  76. on goNext
  77.   set gInstructStep to gInstructStep + 1
  78.   set the member of sprite gTextSprite to getAt(gPageList, gInstructStep)
  79.   setButtons()
  80. end
  81.  
  82. on goPrev
  83.   set gInstructStep to gInstructStep - 1
  84.   set the member of sprite gTextSprite to getAt(gPageList, gInstructStep)
  85.   setButtons()
  86. end
  87.  
  88. on doButtonHilite ActionHandler
  89.   set myNormalButton to the castNum of sprite the clickOn
  90.   set myHiliteButton to myNormalButton + 1
  91.   set the castNum of sprite the clickOn to myHiliteButton
  92.   updateStage()
  93.   repeat while the stillDown
  94.     if rollOver(the clickOn) then
  95.       set the castNum of sprite the clickOn to myHiliteButton
  96.     else
  97.       set the castNum of sprite the clickOn to myNormalButton
  98.     end if
  99.     updateStage()
  100.   end repeat
  101.   set the castNum of sprite the clickOn to myNormalButton
  102.   updateStage()
  103.   if rollOver(the clickOn) then
  104.     if not voidp(ActionHandler) then
  105.       do(ActionHandler)
  106.     end if
  107.   end if
  108. end
  109.  
  110. on updateWindow
  111.   setButtons()
  112.   if objectp(window gWizWindow) then
  113.     tell window gWizWindow
  114.       stuffInstructions()
  115.     end tell
  116.   else
  117.     put "telling stage"
  118.     tell the stage
  119.       stuffInstructions()
  120.     end tell
  121.   end if
  122. end
  123.